﻿namespace WatiNSahi.Extensions
{
    using global::WatiN.Core;

    public static class CheckBoxCollectionExtensions
    {
        public static bool Exists(this CheckBoxCollection checkBoxCollection, string checkBoxIdOrNameOrValueOrClass, bool extension = true)
        {
            return checkBoxCollection.Exists(Find.ById(checkBoxIdOrNameOrValueOrClass)) || 
                checkBoxCollection.Exists(Find.ByName(checkBoxIdOrNameOrValueOrClass)) ||
                checkBoxCollection.Exists(Find.ByValue(checkBoxIdOrNameOrValueOrClass)) ||
                checkBoxCollection.Exists(Find.ByClass(checkBoxIdOrNameOrValueOrClass)) ||
                checkBoxCollection.Exists(Find.ByLabelText(checkBoxIdOrNameOrValueOrClass));
        }
    }
}
